<?php
    require_once('db.php');
    require_once('functions.php');
    $get = $_GET["get"];
	
	switch($get)
	{
		case 'sessions':
			$data = get_sessions();
		break;
		
		case 'game':
			$data = get_game($_GET["session"], $_GET["player"]);
		break;
	}
	
	echo json_encode($data);
?>